﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace livingwellclinic
{
    public partial class Appointments : System.Web.UI.Page
    {
        SortedList appointmentinfo = new SortedList();
        
        string name;
        string day;
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void cancelbutton_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }

        protected void Button_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedIndex == 0)
                ddldate.IsValid = false;
            else
            {
                ddldate.IsValid = true;
                name = firstnametxt.Text;
                day = Convert.ToString(DropDownList1.SelectedValue);
                appointmentinfo.Add("day", day);
                appointmentinfo.Add("name", name);
                Session.Add("AppointmentSession", appointmentinfo);
                MultiView1.ActiveViewIndex = 1;
                lblday.Text = (string)appointmentinfo.GetByIndex(0);
                lblname.Text = (string)appointmentinfo.GetByIndex(1);
            }
        }
    }
}